Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(geocore): fixed errors with sublayers showing as loading endlessly #2700

Merged

Conversation

DamonU2
Copy link
Member

@DamonU2 DamonU2 commented Jan 21, 2025

Also fixes issues with legend not loading
Closes #2689

Description

Fixes issues with invalid extent from the metadata causing issues. Also checks for legend icons and bounds once layer is loaded.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

https://damonu2.github.io/geoview/add-layers.html
5a65ad7c-561a-466a-8375-8d876624df9d

Checklist:

  • I have build (rush build) and deploy (rush host) my PR
  • I have connected the issues(s) to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have created new issue(s) related to the outcome of this PR is needed
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This change is Reviewable

@DamonU2 DamonU2 requested a review from jolevesq January 21, 2025 17:47
@DamonU2 DamonU2 self-assigned this Jan 21, 2025
@jolevesq jolevesq requested a review from Alex-NRCan January 21, 2025 19:00
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan and @DamonU2)


packages/geoview-core/src/geo/layer/layer.ts line 709 at r1 (raw file):

            const legendLayerInfo = LegendEventProcessor.getLegendLayerInfo(this.getMapId(), payload.layerPath);
            // Ensure that the layer bounds and legend icons are set when the layer is loaded
            if (legendLayerInfo && !legendLayerInfo.bounds) LegendEventProcessor.getLayerBounds(this.getMapId(), payload.layerPath);

If bounds are not set but icons is, would it pass the function without triggering a logError?

Copy link
Member Author

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan and @jolevesq)


packages/geoview-core/src/geo/layer/layer.ts line 709 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

If bounds are not set but icons is, would it pass the function without triggering a logError?

Yes, the catch is just there because it is required for an async function

Copy link
Member

@Alex-NRCan Alex-NRCan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @DamonU2 and @jolevesq)


packages/geoview-core/src/geo/layer/layer.ts line 716 at r1 (raw file):

              });

            this.#emitLayerLoaded({ layer: sender, layerPath: payload.layerPath });

Question: As it is, the emitLayerLoaded will be emitted before the queryLegend() has terminated. I don't remember if that's alright or not (based on the layer statuses). So, basically asking if that's what we want. If so, all good. If not, maybe we're missing an await here.

Copy link
Member

@Alex-NRCan Alex-NRCan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @DamonU2 and @jolevesq)


packages/geoview-core/src/geo/layer/layer.ts line 716 at r1 (raw file):

Previously, Alex-NRCan (Alex) wrote…

Question: As it is, the emitLayerLoaded will be emitted before the queryLegend() has terminated. I don't remember if that's alright or not (based on the layer statuses). So, basically asking if that's what we want. If so, all good. If not, maybe we're missing an await here.

Reading the code again, it probably aligns with how it was before.
Therefore, my question should rather be, is the queryLegend() in LegendsLayerSet not good enough to do this over there instead of here? I'm likely missing some context explaining this change.

Copy link
Member Author

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Alex-NRCan and @jolevesq)


packages/geoview-core/src/geo/layer/layer.ts line 716 at r1 (raw file):

Previously, Alex-NRCan (Alex) wrote…

Reading the code again, it probably aligns with how it was before.
Therefore, my question should rather be, is the queryLegend() in LegendsLayerSet not good enough to do this over there instead of here? I'm likely missing some context explaining this change.

Yeah, looking a little deeper, this probably isn't helping. We're having issues with some layers querying the legend before the style is set, and not updating once the style is there, but this doesn't fix that. Removed and I'll look elsewhere.

@DamonU2 DamonU2 force-pushed the 2689-CESI-layer-issues branch 2 times, most recently from ea5922c to e25b7f6 Compare January 22, 2025 17:59
@DamonU2 DamonU2 force-pushed the 2689-CESI-layer-issues branch from e25b7f6 to 55b5eaa Compare January 22, 2025 18:00
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan)

@jolevesq jolevesq merged commit 7142523 into Canadian-Geospatial-Platform:develop Jan 22, 2025
5 of 6 checks passed
@DamonU2 DamonU2 deleted the 2689-CESI-layer-issues branch January 22, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - 1 CESI LAyer [OSDP-1915]
3 participants